const phoneReg = /^[1][3-9][0-9]{9}$/;
const urlReg = /^(?:(http|https|ftp):\/\/)?((?:[\w-]+\.)+[a-z0-9]+)((?:\/[^/?#]*)+)?(\?[^#]+)?(#.+)?$/i;
export const isValidPhone = (str) => {
	if (!phoneReg.test(str)) {
		return false;
	} else {
		return true;
	}
}
export const isValidUrl = (str) => {
	if (!urlReg.test(str)) {
		return false;
	} else {
		return true;
	}
}

export const getStringByte = (str='')=>{
	 return str.split('').reduce((r,c)=>r+=c.charCodeAt(0)>255?2:1,0)
}